﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Finisar.SQLite;
using System.Data;
using Nova.dataDataSetTableAdapters;

namespace Nova
{
    public class StudentsDataProvider
    {
        private dataDataSet dataset;
        private StudentsTableAdapter adapter;

        public StudentsDataProvider()
        {
            dataset = new dataDataSet();
            adapter = new StudentsTableAdapter();
            adapter.Fill(dataset.Students);

            //dataset.BudgetView.BudgetViewRowChanged +=
            //     new NovaDataSet.BudgetViewRowChangeEventHandler(BudgetViewRowModified);
            //dataset.BudgetView.BudgetViewRowDeleted +=
            //    new NovaDataSet.BudgetViewRowChangeEventHandler(BudgetViewRowModified);


        }

        //void BudgetViewRowModified(object sender, NovaDataSet.BudgetViewRowChangeEvent e)
        //{
        //    //adapter.Update(dataset.BudgetView);
        //}

        public DataView GetStudents()
        {
            DataView dv = dataset.Students.DefaultView;
            dv.AllowNew = false;
            return dv;
        }
    }
}